
/*
 * $HeadURL: http://catwork.googlecode.com/svn/trunk/root/static/js/catwork/apidoc/viewer.js $
 * $Id: viewer.js 2 2011-03-20 16:14:09Z hg.winkler.77 $
*/

function render_apidoc (PATH,NAME) {

    remove_infos();
    remove_warnings();
    remove_errors();
    
    jQuery.ajax({
        type: "POST",
        dataType: "json",
        async: false,
        url: "/ws/apidoc/get/doc/json/",
        data: {path : PATH, name: NAME},
        success: function post_process_result (data) {
            $("#summary_results").empty();
            $("#search_results").empty();
            $("#footer").empty();
            $("#footer").append(data.footer);
            $("#header_subtitle").empty();
            $("#header_subtitle").append(data.header_subtitle);
            $("#inner_content").empty();
            $("#inner_content").append(data.html);
            show_warnings('Render warnings:',data.warnings);
            $.jGrowl("Render action for "+NAME+" was proceded", { header: "Message:"});
        }
      });
}

function get_single_search_result (PATH,SEARCH) {

    remove_infos();
    remove_warnings();
    remove_errors();
    
    jQuery.ajax({
        type: "POST",
        dataType: "json",
        async: false,
        url: "/ws/apidoc/get/single_search_result/json/",
        data: {path : PATH, search: SEARCH},
        success: function post_process_result (data) {
            $("#summary_results").empty();
            $("#footer").empty();
            $("#footer").append(data.footer);
            $("#header_subtitle").empty();
            $("#header_subtitle").append(data.header_subtitle);
            $("#inner_content").empty();
            $("#inner_content").append(data.result.html);
            show_warnings('Render warnings:',data.result.warnings);
            $.jGrowl("Render action was proceded", { header: "Message:"});
        }
      });

}
